import request from '@/utils/require'
export const getUserManageList = params => {
  return request({
    url: '/user-manage/list',
    params
  })
}

/**
 * 批量上传
 * @param {*} data
 * @returns
 */
export const userBatchImport = data => {
  return request({
    url: '/user-manage/batch/import',
    method: 'POST',
    data
  })
}

/**
 * 通过id删除指定用户
 * @param {*} id
 * @returns
 */
export const userDelectById = id => {
  return request({
    url: `/user-manage/detele/${id}`
  })
}

/**
 * 获取所有员工列表
 * @param {*} id
 * @returns
 */
export const userAllList = id => {
  return request({
    url: '/user-manage/all-list'
  })
}

/**
 * 获取员工详情
 * @param {*} id
 * @returns
 */
export const userDetail = id => {
  return request({
    url: `/user-manage/detail/${id}`
  })
}

/**
 * 获取指定用户的角色
 * @param {*} id
 * @returns
 */
export const userRoles = id => {
  return request({
    url: `/user-manage/role/${id}`
  })
}

/**
 * 为指定用户分配角色
 * @param {*} id
 * @returns
 */
export const updateRoles = (id, roles) => {
  return request({
    url: `/user-manage/update-role/${id}`,
    method: 'post',
    data: {
      roles
    }
  })
}
